<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<button @click="getval">获取内容</button>
			<h3 ref="title">我是标题标签</h3>
			<p ref="op">我是一个p标签</p>
		</div>
		
	<script>
		var vm=new Vue({
			el:"#app",
			data:{
				
			},
			methods:{
			   getval(){
				   //console.log(document.querySelector('h3').innerText)
				   console.log(this.$refs.title.innerText)
				   this.$refs.title.style.color="red"
			   }
			}
		})
		
	</script>	
	</body>
</html>
